home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Documentation / Tech Notes & Articles / Recipes / Standards / Calling parent-methods next >
Encoding:
Text File  |  1995-10-17  |  1.5 KB  |  33 lines  |  [TEXT/ttxt]

  1. OpenDocâ„¢ Recipes
  2.  
  3. Making parent method calls
  4. By The OpenDoc Design Team
  5. August 23rd, 1995
  6.  
  7.  
  8. © 1993-1995  Apple Computer, Inc. All Rights Reserved.
  9. Apple, the Apple logo, and Macintosh are registered trademarks of Apple Computer, Inc.
  10. Mac and OpenDoc are trademarks of Apple Computer, Inc.  (Palatino/10/Plain)
  11.  
  12.  
  13. Making parent method calls
  14.  
  15. According to SOMobjects Developer Toolkit Users Guide 4-56,
  16.  
  17. "... the overriding method procedure can conveniently invoke the procedure that one or more of the parent classes uses to implemnt that method... " and
  18.  
  19. "The SOM-generated implementation header file defines the following macros for making parent-method calls from within an overriding method: 
  20. <className>_parent_<parentClassName>_<methodName>
  21. (for each parent class of the class overriding the method), and 
  22.  
  23. <className>_parents_<methodName>."
  24.  
  25. Making parent method calls in OpenDoc
  26.  
  27. In OpenDoc, we recommend the use of the first form to make a parent-method call.
  28.  
  29. For example,  if a part (called MyPart) needs to call its parent ODPart's InitPart method, it should use the following macro (defined in MyPart's implementation header file):
  30.  
  31. MyPart_parent_ODPart_InitPart(somSelf,ev,storageUnit,partWrapper)
  32.  
  33. WARNING: There are other macros that are generated by SOM for making parent-method calls. However, those short forms may be ambiguous if multiple inheritance is used. Also, some of these short forms exist only for backward compatibility and may not be supported in future versions of SOM.